package com.huaxin.dss2.util;

import lombok.extern.slf4j.Slf4j;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.Properties;

/**
 *
 * @author HX-119
 * @date 2014/5/9
 */
@Slf4j
public class ResourcesPropertiesUtil {

    private static Properties properties = new Properties();
    static {
        try {
            properties.load(new FileInputStream(System.getProperty("user.dir")+ File.separator+"conf"+ File.separator+"config.properties"));
        } catch (IOException e) {
            log.error(e.getMessage());
        }
    }

    private ResourcesPropertiesUtil() {

    }

    public static String getString(String propertyName) {
        return properties.getProperty(propertyName);
    }

    public static int getInt(String propertyName) {
        String property = properties.getProperty(propertyName);
        return Integer.valueOf(property);
    }

}
